Recent years have seen the rapid advancement and proliferation of electronic devices, which devices often require updating of the resident firmware, operating code, applications or other software loaded thereon, collectively, “binary images”, or simply “images”. Moreover, installing and updating of such binary images is becoming routine where advancements applicable to a particular device far outpace the rate at which it is desirable to retire the unit and replace it with an entirely new unit.
Moreover, for many devices for which updating the binary image is desirable, these same devices may be remotely located and it is not practical for many reasons to return or collect the device in order that it can be directly connected to a host updating machine or system.
Also, in applying an update to install a new image, it is not uncommon for power loss or other interruptions to the subject device to occur which leads to failure of the installation. This may result in the installation process having to begin again from the start, or worse, leaving a device disabled or wholly inoperable due to a partial install from which it cannot recover or reinitiate. Additionally, with limited memory on the device itself, whether it is a mobile phone, personal digital assistant, pager or any other variety of small form factor portable devices, delivery of an entire new image is often infeasible due to the capacity limitations (e.g. communications bandwidth, available memory, etc.) of the device.
Initially, these mobile devices were developed using NOR flash memory hardware as their storage medium. NOR flash memory enables relatively fast random access to the flash for the purpose of executing code. However, it does not provide rapid write performance. The large erase blocks typically associated with NOR, the overhead required supporting their erasure, and typically lengthy programming times, limit its use for significant data storage applications. Today, NOR flash chips as large as 16 MB are being used to store entire operating system images such as Windows CE. In devices such as basic cellular phones where code size is relatively small or where there's no performance requirement beyond what can be achieved with direct code execution, NOR flash chips have been the undisputed design choice. Further contributing to the success of NOR in these environments is the fact that there's typically no requirement for storing large amounts of data.
Historically, NOR flash memory has been the prevalent storage medium for executable code, such as power-on boot loaders and BIOS software in mobile devices. The relatively fast access times of NOR and the ability to linearly address the flash within a devices memory space suggest it is suitable for storing software applications.
Advances in the design and manufacture of flash memory have produced a second type of flash memory available for use in mobile devices, in addition to NOR flash memory. This second flash memory, known as NAND flash memory, provides a more attractive solution to designers due to its increased capacity and reduced cost. Mobile devices today, leveraging 2.5G and 3G cellular technologies, now require increasing amounts of storage for both data and applications. The desirability to deploy mobile devices based on NOR flash memory is decreasing as new features realized have increase demands for local code and data storage. The design of NAND flash memory emphasizes increased write performance, higher density, and lower cost. Write performance improvements are achieved through a page-oriented management of the flash and smaller sized erase blocks. Use of a smaller flash cell size has allowed NAND memory devices to attain higher densities (i.e. higher storage capacities) than experienced with NOR memory devices. Reductions in cell size, and total device pin count of NAND's input/output interface, have both contributed to yielding a significantly lower manufacturing cost. NAND's write performance however, drastically distances it from NOR. When transferring large amounts of data, particularly data that crosses over erase block boundaries; the disparity tends to be dramatic. This is one of the reasons that NAND has been so successful in digital cameras and other platforms that require disk-like storage.
NAND flash, which has somewhat slower read access times, and a non-linear interface, has typically not been used for storing code (i.e. applications). Instead, it has been deployed as a disk-like repository for application data. Its higher density and superior write performance make it well suited for devices that require large amounts of data storage. Today, however, the traditional use of these flash technologies is being revisited, as computer manufacturers continue to find ways to reduce costs.
With NAND memory priced at less than one half the cost of NOR memory, system designers are pioneering new methods of using NAND for code (i.e. applications and operating system components) as well as data storage. Techniques have been realized that can be used to boot from (i.e. start) and execute code that is stored in NAND flash.
Accordingly there is a need for an efficient, effective and reliable method for receiving, storing, and applying an update to a device utilizing NAND flash memory hardware that does not require the unit to be returned to a service center for update and instead uses an update package that can modify the binary image in-situ, to modify existing software applications or operating system components. And, there exists need for a complimentary mechanism or technique to allow for recovery and continued application of an update to such device, even when being updated remotely and without access to a host update or boot rescue system.
Systems for over-the-air update of firmware on portable devices such as mobile telephones have been designed and deployed for those devices based on NOR technology. In such a system, an update package representing the differences between the original and new firmware images is created and place on a server machine, available for download. A known manner in reducing the size of a new image update, developed for NOR based mobile devices, is to use a differencing algorithm or binary differencing engine that compares the current or existing binary image with the new binary image to produce a list of differences. Such differences, in a general sense, are typically output or expressed as sequences or sets of ADD and COPY operations such that the new image can be created by combining together binary sequences copied from the original image resident on the device (a COPY operation) and interlacing them with binary sequences from the new image (contained within the update package) for which a suitable copy sequence was not available in the original image (an ADD operation).
The ADD operation specifies a list of bytes that must be copied into the new image at the current location, and the COPY operation specifies a number of bytes to be copied from a given location in the original image to the current update location in the new image.
The method developed for reducing the size of a new image update for NOR based devices remains an appropriate mechanism for today's more sophisticated mobile devices employing NAND memory technology.
The present invention addresses the remote update of a mobile device in which the majority of the operating system components and software applications (e.g. email client, micro-browser, calendar, etc.) reside in a read-only file system in NAND flash memory. This invention provides a method to receive, store and apply update packages transferred to the device in a complementary manner to that used for NOR based devices.
This invention addresses the known disadvantages and limitations experienced when using NAND flash memory devices versus NOR flash memory.
Current methods do not typically provide access to the operating system facilities when updating devices in which the firmware resides in conventional NOR type flash memory. The update package must typically be stored in a dedicated area of flash commonly referred to as the workspace. This workspace may also contain state information used by the update agent. Thus, the amount of spare flash memory that can be devoted to the workspace area determines the maximum possible update package size. The update mechanism (i.e. update agent) is normally a small standalone program or is part of the bootstrap code. It is accessed or entered by rebooting the device. Once the device is booted in this configuration, the operating system software, which in fact is modified during the update process, does not execute (i.e. run) and is not available during the updating of the flash firmware. As the update package is decode by the update agent, it then makes use of it's own hardware drivers to reprogram the stored firmware image. This is achieved using a combination of read, copy, erase, and write operations directly to the NOR flash hardware.
Information stored in NOR flash memory is read by accessing the data in a byte-by-byte manner. This allows the operating system of the device to be executed directly from NOR flash using a technique known as execute-in-place. Writing to NOR flash is accomplished by first copying a flash block, followed by erasing the block that was copied, and then writing new data to this block of flash memory. The processing required for this update method should be obvious to one skilled in the art.
However, the update mechanism for NAND flash memory differs from that of NOR based devices. In particular, NAND flash memory hardware devices are not byte addressable as in NOR devices. NAND devices can only be read or written using page-sized units. As a result they do not support execute-in-place techniques, instead they are accessed, similar to a disk, with memory blocks being read into Random Access Memory (RAM) for execution. In addition, NAND flash memory may be delivered with a number of bad blocks present, and it is possible for further blocks to turn bad during operational use. To mitigate this affect, semiconductor manufacturers have developed a bad block manager (BBM) component, typically built into the operating system, to provide a suitable interface for other software to interact reliably with NAND flash memory. A flash translation layer (FTL) is also used, placed between a file system implementation and BBM, to hide block erasure and provide a disk-like sector read/write interface. The manufacturer of the NAND flash hardware device also normally supplies the FTL.
The need therefore is for a method that addresses the different reprogramming operations associated with mobile devices based on NAND memory hardware for storage to support updating current versions of applications and operating system components. In addition, a design that enables a bad block manager to be used when writing to NAND flash memory devices at the block read/write/erase level is desirable. Moreover, a design that enables access to state information, an update package, and a backup block (i.e. similar to the workspace area utilized in NOR flash) through a bad block manager may provide other advantageous qualities over previously know designs.